with open("output/test_results.tsv") as f:
    lines = f.readlines()
with open("data/test.tsv", encoding="utf-8") as f:
    indice = f.readlines()

threshold = input("Enter a threshold(default is 0.925): ")
try:
    threshold = float(threshold)
except:
    threshold = 0.925

print("threshold is", threshold)

with open("MG1833068-"+str(threshold)+".txt", "w") as f:
    for i in range(len(lines)):
        line = indice[i].split()
        index = int(line[0])
        line = lines[i].split()
        a, b = line[0],line[1]
        a = float(a)
        b = float(b)
        s = "%d\t%s\n" %(index, 1 if a < threshold else 0)
        f.write(s)

